<?php
    session_start();
    include("../lib/DataProvider.php");

    if(isset($_SESSION["MaTaiKhoan"]) == false || $_SESSION["MaLoaiTaiKhoan"] != 2)
      DataProvider::ChangeURL("../index.php?a=3");

    if(isset($_GET['b']) == true)
        $b = $_GET['b'];
    else
        $b = 1;

    if(isset($_GET['user']) == true)
        {
            $user = $_GET['user'];
            $b = 0;
        }
    else
        $user = 0;

    if(isset($_GET['nxb']) == true)
        {
            $nxb = $_GET['nxb'];
            $b = 0;
        }
    else
        $nxb = 0;

    if(isset($_GET['loai']) == true)
        {
            $loai = $_GET['loai'];
            $b = 0;
        }
    else
        $loai = 0;

    if(isset($_GET['chitietloai']) == true)
        {
            $chitietloai = $_GET['chitietloai'];
            $b = 0;
        }
    else
        $chitietloai = 0;

    if(isset($_GET['sach']) == true)
        {
            $sach = $_GET['sach'];
            $b = 0;
        }
    else
        $sach = 0;

     if(isset($_GET['tintuc']) == true)
        {
            $tintuc = $_GET['tintuc'];
            $b = 0;
        }
    else
        $tintuc = 0;

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />

    <title>Admin Control Panel</title>

    <link rel="icon" type="image/ico" href="favicon.ico"/>

    <link href="css/stylesheets.css" rel="stylesheet" type="text/css" />
    <link rel='stylesheet' type='text/css' href='css/fullcalendar.print.css' media='print' />

<!-- :::::::::::::::::Javascript::::::::::::::::: -->
    <?php
            include("pages/pJS.php");
    ?>

</head>

<body>

    <div class="header">
        <a class="logo" href="../index.php"><img src="img/logo.png" alt="Admin Control Panel" title="Admin Control Panel"/></a>
        <ul class="header_menu">
            <li class="list_icon"><a href="#">&nbsp;</a></li>
        </ul>
    </div>

    <div class="menu">
        <?php
            include("pages/pMenu.php");
        ?>
    </div>

    <div class="content">
        <div class="breadLine">
            <ul class="buttons">
            </ul>
        </div>
        <div class="workplace">

                <?php
                    switch ($b) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pContent.php");
                            break;
                        case 2:
                            include("pages/pTinTuc.php");
                            break;
                        case 3:
                            include("pages/pUser.php");
                            break;
                        case 4:
                            include("pages/pSach.php");
                            break;
                        case 5:
                            include("pages/pNXB.php");
                            break;
                        case 6:
                            include("pages/pLoai.php");
                            break;
                        case 7:
                            include("pages/pChiTietLoai.php");
                            break;
                        case 8:
                            include("pages/pCart.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }
                    switch ($user) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pSuaUser.php");
                            break;
                        case 2:
                            include("pages/pXoaUser.php");
                            break;
                        case 3:
                            include("pages/pThemUser.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }

                    switch ($nxb) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pSuaNXB.php");
                            break;
                        case 2:
                            include("pages/pXoaNXB.php");
                            break;
                        case 3:
                            include("pages/pThemNXB.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }

                    switch ($loai) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pSuaLoai.php");
                            break;
                        case 2:
                            include("pages/pXoaLoai.php");
                            break;
                        case 3:
                            include("pages/pThemLoai.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }

                    switch ($chitietloai) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pSuaChiTietLoai.php");
                            break;
                        case 2:
                            include("pages/pXoaChiTietLoai.php");
                            break;
                        case 3:
                            include("pages/pThemChiTietLoai.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }

                    switch ($sach) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pSuaSach.php");
                            break;
                        case 2:
                            include("pages/pXoaSach.php");
                            break;
                        case 3:
                            include("pages/pThemSach.php");
                            break;
                        case 4:
                            include("pages/pSubSach.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }

                    switch ($tintuc) {
                        case 0:
                            break;
                        case 1:
                            include("pages/pSuaTinTuc.php");
                            break;
                        case 2:
                            include("pages/pXoaTinTuc.php");
                            break;
                        case 3:
                            include("pages/pThemTinTuc.php");
                            break;

                        default:
                            include("../pages/pError.php");
                            break;
                    }
                ?>
        </div>
    </div>

</body>
</html>
